﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EcomProduct.Web.UI;
using EcomProduct.Data;

public partial class Admin_ArticleEdit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FormUtil.RedirectAfterInsertUpdate(FormView1, "ArticleEdit.aspx?{0}", ArticleDataSource);
        FormUtil.RedirectAfterAddNew(FormView1, "ArticleEdit.aspx");
        FormUtil.RedirectAfterCancel(FormView1, "Article.aspx");
        FormUtil.SetDefaultMode(FormView1, "Id");
        //DataRepository.ArticleProvider.GetByIdIsRemoved(
    }

    protected void FormView1_ItemCreated(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                // Get original Id
                if (FormView1.CurrentMode == FormViewMode.Edit)
                {
                    TextBox dataOriginalId = (TextBox)FormView1.Row.FindControl("dataOriginalId");
                    dataOriginalId.Text = "999999";

                }
            }
        }
        catch (Exception ex)
        {
            LogController.WriteLog(ex);
        }
    }
}